package com.robot.controller.tool;


import com.robot.model.Protocol;
import com.robot.util.HttpClientUtil;
import com.robot.vo.ResponseMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created with IntelliJ IDEA.
 * User: li
 * Date: 2019/8/11
 * Time: 13:59
 * PROJECT：robot
 * PACKAGE: com.robot
 *
 * @author:55324936@qq.com To change this template use File | Settings | File Templates.
 */
@Controller
@RequestMapping("/http")
public class HttpController {
    @RequestMapping("/httpToolPage")
    public String httpPage(){
        return "/tool/httpPage";
    }

    @Autowired
    HttpClientUtil httpClientUtil;

    @RequestMapping("/invoke")
    public @ResponseBody
    ResponseMessage invoke(Protocol http){
      ResponseMessage responseMessage = httpClientUtil.invoke(http);
      return responseMessage;
    }
}
